<?php

/**
 * Vuelo filter form base class.
 *
 * @package    aeropostal
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseVueloFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'matricula'    => new sfWidgetFormPropelChoice(array('model' => 'Aeronave', 'add_empty' => true, 'key_method' => 'getMatricula')),
      'num_Vuelo'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'nomb_Capitan' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'matricula'    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Aeronave', 'column' => 'matricula')),
      'num_Vuelo'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nomb_Capitan' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('vuelo_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Vuelo';
  }

  public function getFields()
  {
    return array(
      'id'           => 'Number',
      'matricula'    => 'ForeignKey',
      'num_Vuelo'    => 'Number',
      'nomb_Capitan' => 'Text',
    );
  }
}
